**************************************************
********* Figure A9.1: Distribution of Latina and* 
********* Latino Candidates Post Redistricting:***
********* 2000 and 2010***************************
**************************************************

do "do_files/prep_GRACE_data/load_prep_GRACE_data.do"

***latx gender categorical variable for using spineplot command***
gen latx=1 if basket_latw==1
replace latx=2 if basket_latm==1
replace latx=0 if latx==.


* plot a spineplot for each round of redistricting, 
* type of district on the y axis and latx on the x axis.
set scheme plotplain

by latxonballot_2000g5  latx, sort: gen Q0 = _N
spineplot latxonballot_2000g5 latx if postred2000==1, text(Q0) title(Latina/os on Ballots Post 2000 Redistricting) yla(none) ytitle("") ysc(noline) xtitle("") xsc(noline)

* pausing for users who might be looping through all replication files
pause


by latxonballot_2010g5  latx, sort: gen Q = _N
spineplot latxonballot_2010g5 latx if postred2010==1, text(Q) title(Latina/os on Ballots Post 2010 Redistricting) 
* pausing for users who might be looping through all replication files
pause
